<template>
  <div class="dashboard-editor-container">

    <panel-group @handleSetLineChartData="handleSetLineChartData" />

    <el-row :gutter="32">
      <!-- 年龄分布 -->
      <el-col :xs="24" :sm="24" :lg="12">
        <div class="chart-wrapper">
          <AgeChart></AgeChart>
        </div>
      </el-col>
      <!-- 学历分布 -->
      <el-col :xs="24" :sm="24" :lg="12">
        <div class="chart-wrapper">
          <BarChart></BarChart>
        </div>
      </el-col>
    </el-row>

    <el-row :gutter="32">
      <!-- 工作年限分布 -->
      <el-col :xs="24" :sm="24" :lg="12">
        <div class="chart-wrapper">
          <PieChart></PieChart>
        </div>
      </el-col>
      <!-- 薪资分布 -->
      <el-col :xs="24" :sm="24" :lg="12">
        <div class="chart-wrapper">
          <line-chart />
        </div>
      </el-col>
    </el-row>
    
  </div>
</template>

<script>
import PanelGroup from './dashboard/PanelGroup'
import LineChart from './dashboard/LineChart'
import RaddarChart from './dashboard/RaddarChart'
import PieChart from './dashboard/PieChart'
import BarChart from './dashboard/BarChart'
import AgeChart from './dashboard/AgeChart'

export default {
  name: 'Index',
  components: {
    PanelGroup,
    LineChart,
    RaddarChart,
    PieChart,
    BarChart,
    AgeChart
  },
  data() {
    return {
    }
  },
  methods: {
    handleSetLineChartData(type) {
      if (type == 'resume') {
        this.$router.push({ path: '/resume/presentation' })
      } else if (type == 'job') {
        this.$router.push({ path: '/job' });
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard-editor-container {
  padding: 32px;
  background-color: rgb(240, 242, 245);
  position: relative;

  .chart-wrapper {
    background: #fff;
    padding: 16px 16px 0;
    margin-bottom: 32px;
  }
}

@media (max-width:1024px) {
  .chart-wrapper {
    padding: 8px;
  }
}
</style>
